//
//  MyWalletViewController.m
//  BigJoy
//
//  Created by Rowling on 2017/6/20.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import "MyWalletViewController.h"
#import "CashAdvanceViewController.h"
#import "CustomAlerView.h"
#import "RecordViewController.h"
#import "TicketViewController.h"
#import "CashAdvanceListControllerViewController.h"
#import "CheckPhoneView.h"

@interface MyWalletViewController ()
@property (weak, nonatomic) IBOutlet UIView *mingxiView;
@property (weak, nonatomic) IBOutlet UIView *youhuiquanView;
@property (weak, nonatomic) IBOutlet UIView *tixianView;
@property (weak, nonatomic) IBOutlet UILabel *moneyLable;
@end

@implementation MyWalletViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我的钱包";
    [self addTapToView];
}


#pragma -mark:click
-(void)addTapToView {
    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    [self.mingxiView addGestureRecognizer:tap];
    UITapGestureRecognizer * tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    [self.youhuiquanView addGestureRecognizer:tap1];
    UITapGestureRecognizer * tap2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap:)];
    [self.tixianView addGestureRecognizer:tap2];
}

-(void)tap:(UITapGestureRecognizer *)tap {
    NSInteger tag = tap.view.tag - 100;
    if (tag == 0) {
        // 交易明细
        RecordViewController * vc = [[RecordViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
    }
    if (tag == 1) {
        TicketViewController * vc = [[TicketViewController alloc]init];
        [self.navigationController pushViewController:vc
                                             animated:YES];
    }
    if (tag == 2) {
        CashAdvanceListControllerViewController * vc = [[CashAdvanceListControllerViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES
         ];
    }
}

- (IBAction)tixianButtonClick:(id)sender {
    CheckPhoneView * checkView = [CheckPhoneView fastLogin];
    [checkView setCompleBlock:^{
        CashAdvanceViewController * vc = [[CashAdvanceViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
    }];
    checkView.frame = XMKEYWINDOWXM.bounds;
   [CustomAlerView showMessageWith:@"您还未绑定微信，请先绑定微信后再申请提现！" leftStr:@"前往绑定" leftAction:^{
       [XMKEYWINDOWXM addSubview:checkView];
   }];
//    return;

}


@end
